perm filename GALLEY.TMP[FIG,DEK] blob sn#800722 filedate 1985-09-01 generic text, type C, neo UTF8
COMMENT āŠ—   VALID 00010 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	% This page should match page 2 of MANUAL.MF,
C00004 00003
C00009 00004
C00013 00005	"Figure 18d" % I by outlines
C00016 00006	end
C00019 00007	th=20
C00021 00008	"Figure 16h" % fancy serif with pencircle
C00023 00009
C00025 00010
C00026 ENDMK
CāŠ—;
% This page should match page 2 of MANUAL.MF,
% because I'm testing stuff to add to that file

def clear_all = clearit; clearxy; pickup standardpen;
proofrulethickness 0;
enddef;

def heavy_dot expr z =
 makelabel.top("",z-(1,0));
 makelabel.top("",z+(1,0));
 makelabel.top("",z-(0,1));
 makelabel.top("",z+(0,1));
 makelabel.top("",z+(1,1)/sqrt2);
 makelabel.top("",z+(1,-1)/sqrt2);
 makelabel.top("",z-(1,1)/sqrt2);
 makelabel.top("",z-(1,-1)/sqrt2);
 enddef;

def font_setup=
define_pixels(u,tiny,axis,hheight,border);
define_blacker_pixels(hair,thin,thick,rulethickness);
pickup if tiny<.5: nullpen else: pencircle scaled tiny fi;
tinypen:=savepen;
currenttransform:=identity slanted slant yscaled aspect_ratio;
enddef;

mode=proof; mode_setup;
standardpen=savepen;
"Figure 18d"; % I by outlines
clear_all;
def serif(suffix $)(expr breadth,theta,left_jut,right_jut)=
 penpos$(breadth/abs sind theta,0);
z$a-z$l=z$f-z$r=(bracket/abs sind theta)*dir theta;
y$c=y$d; y$b=y$e=y$; y$b-y$c=if theta<0:-fi slab;
x$b=x$c=x$l-left_jut; x$d=x$e=x$r+right_jut;
labels($a,$b,$c,$d,$e,$f) enddef;

def serif_edge suffix $ =
 (serif_bracket($a,$l,$b)--z$c
  --z$d--reverse serif_bracket($f,$r,$e)) enddef;

def serif_bracket(suffix i,j,k) =
 (z.i{z.j-z.i}...serif_darkness[z.j,.5[z.i,z.k] ]{z.k-z.i}
  ...z.k{z.k-z.j}) enddef;

serif_darkness:=1/3;
slab#:=1/3pt#;
bracket#:=2/3pt#;
jut#:=1pt#;
u#:=3/5pt#;
ht#:=7pt#;
thin#:=1/4pt#;
thick#:=1pt#;
define_pixels(slab,bracket,jut,u,ht,thin,thick);

beginchar("A",12u#,ht#,0);
z1=(.5w,round 1.05h); x4l=w-x5r=u; y4l=y5r=slab;
numeric theta[]; theta4=angle(z1-z4l); theta5=angle(z1-z5r);
serif(4,thin,theta4,.5jut,jut); serif(5,thick,theta5,jut,.5jut);
z0=z4r+whatever*dir theta4=z5l+whatever*dir theta5;
fill z1--serif_edge4--z0 & z0--serif_edge5--z1 & cycle;
penpos2(whatever,theta4); penpos3(whatever,theta5);
y2r=y3r=.5[y4,y0]; y2l=y3l=y2r-thin;
z2=whatever[z1,z4r]; z3=whatever[z1,z5l];
penstroke z2e--z3e; penlabels(0,1,2,3,4,5);

ww:=w; % special hacks to get two on one
picture tmp; tmp:=currentpicture;
proofrule((w,-d!),(w,h!));
endgroup;

beginchar("I",6u#,ht#,0);
currentpicture:=tmp;
currenttransform:=currenttransform shifted(ww,0);
x1=x2=.5w; y1=h-y2; y2=slab;
serif(1,thick,-90,1.1jut,1.1jut); serif(2,thick,90,1.1jut,1.1jut);
fill serif_edge 2 -- reverse serif_edge 1 -- cycle;
penlabels(1,2);
w:=w+ww;
endchar;

currenttransform:=identity yscaled aspect_ratio;
end
th=20;
bracket_height=40;
dish=5;
jut=10;
vardef serif@#(suffix in,$)(expr left_jut)(suffix $$,out)(expr right_jut) =
y@#1=y@#6=y$ if y$<y.in: + else: - fi bracket_height;
bot y@#3=y@#4=0; x@#3=x$-left_jut; x@#4=x$$+right_jut;
z@#1=whatever[z.in,z$]; z@#2=whatever[z.in,z$];
z@#6=whatever[z.out,z$$]; z@#5=whatever[z.out,z$$];
z@#2=z@#3+whatever*dir th; z@#5=z@#4+whatever*dir-th;
z@#1..controls z@#2..z@#3
 --flex(z@#3-(0,epsilon),.5[z@#3,z@#4]+(0,dish),z@#4-(0,epsilon))
 --z@#4..controls z@#5..z@#6 enddef;


beginchar(0,300/pt,200/pt,0);
pickup pensquare yscaled 5 xscaled 25 rotated th;
z1+(20,0) rotated th=z3; top .5[z1,z3]=(.5w,h);
z2=(60,0); z5=(w-60,0); y4=0; z1-z4=whatever*(z3-z5);
filldraw z1--serif.a(1,2,2jut,2,1,jut)--cycle;
filldraw z1--serif.b(1,4,.5jut,5,3,2jut)--z3--cycle;
labels(1,2,3,4,5,a1,a2,a3,a4,a5,a6,b1,b2,b3,b4,b5,b6);
endchar;
"Figure 16h"; % fancy serif with pencircle
clear_all;
pickup pencircle xscaled .8pt yscaled .2pt rotated 20;
z1=(20,175); bot z3=(0,0);
z4=(50,0); z6=(25,175);
x2=x1; z2=z3+whatever*dir 20;
x5=x6; z5=z4+whatever*dir -20;
pair dishing; dishing=(8,0) rotated 20;
filldraw z1..controls z2..z3
--(flex(z3,.5[z3,z4]+dishing,z4))shifted(0,-epsilon)
-- z4..controls z5..z6--cycle;
showit;
labels(1,2,3,4,5,6);
shipit;